<template>
  <div class="detail_box">
    <div class="title">
      <div>{{ form.pstitle }}</div>
    </div>
    <el-form class="left_from" ref="form" :model="form" :rules="rules" label-width="80px" :disabled="true">

      <el-row :gutter="24" type="flex" justify="space-between">
        <el-col :span="16">
          <el-form-item label="标题" prop="pstitle">
            <el-input v-model="form.pstitle" placeholder="请输入上报舆情标题"/>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="倾向性" prop="tendentiousness">
            <el-select style="width: 100%;" v-model="form.tendentiousness" placeholder="请选择倾向性">
              <el-option
                v-for="dict in dict.type.ps_tendentiousness"
                :key="dict.value"
                :label="dict.label"
                :value="parseInt(dict.value)"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="24" type="flex" justify="space-between">
        <el-col :span="16">
          <el-form-item label="网址" prop="linkUrl">
            <el-input v-model="form.linkUrl" placeholder="请输入网址"/>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="媒体类型" prop="mediaType">
            <el-select style="width: 100%;" v-model="form.mediaType" placeholder="请选择媒体类型">
              <el-option
                v-for="dict in dict.type.ps_media"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="24" type="flex" justify="space-between">
        <el-col :span="11">
          <el-form-item label="来源网站" prop="srcWebset">
            <el-input v-model="form.srcWebset" placeholder="请输入来源网站"/>
          </el-form-item>
        </el-col>
        <el-col :span="11">
          <el-form-item label="发布时间" prop="releaseTime">
            <el-date-picker clearable
                            v-model="form.releaseTime"
                            type="date"
                            style="width: 100%;"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择发布时间">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item label="上报内容">
        <editor ref="editorSon" v-model="form.reportContent" :min-height="192"/>
      </el-form-item>
    </el-form>

  </div>

</template>
<script>
import {listReport, getReport, delReport, addReport, updateReport, dispose, appear, withdraw} from "@/api/report/report";
export default {
  name: "index",
  dicts: ['ps_industry'],
  data() {
    return {
      userInfo: JSON.parse(localStorage.getItem('userinfo')),
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 舆情上报表格数据
      reportList: [],
      // 弹出层标题
      title: "",
      // 上报内容时间范围
      daterangeReleaseTime: [],
      // 上报内容时间范围
      daterangeReportTime: [],
      // 表单参数
      form: {},
    }
  },
 methods:{
   getList(id) {
     getReport(id).then(response => {
       this.form = response.data;
       this.$nextTick(()=>{
         this.$refs.editorSon.Quill.enable(false)
       })
     });

   },
 },
  created() {
    this.Id = this.$route.query.id
    this.getList(this.Id)
  }
}



</script>

<style scoped lang="scss">
.detail_box{
  width: 100%;
  height: calc(100vh - 86px);
  box-sizing: border-box;
  padding: 0 10%;
  overflow-y: auto;
  padding-top: 30px;
  position: relative;
}

.title{
  width: 100%;
  display: flex;
  justify-content: center;
  font-size:22px;
  color: #333;
  font-weight: 600;
  margin-bottom:40px;
  div{
    max-width: 70%;
    overflow:hidden; //超出的文本隐藏
    text-overflow:ellipsis; //用省略号显示
    white-space:nowrap; //不换行
    margin-right: 20px;
  }
}

</style>
